package com.yn.pet.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yn.pet.bus.dao.DeviceSyncSettingsDao;
import com.yn.pet.bus.entity.DeviceSyncSettings;
import com.yn.pet.service.DeviceSyncSettingsService;
import org.springframework.stereotype.Service;

/**
 * 设备同步设置表(DeviceSyncSettings)表服务实现类
 *
 * @author makejava
 * @since 2025-07-09 12:00:47
 */
@Service("deviceSyncSettingsService")
public class DeviceSyncSettingsServiceImpl extends ServiceImpl<DeviceSyncSettingsDao, DeviceSyncSettings> implements DeviceSyncSettingsService {


    /**
     * 根据设备id查询设备同步设置信息
     * @param deviceId 设备id
     * @return DeviceSyncSettings
     */
    @Override
    public DeviceSyncSettings getInfoByDeviceId(Long deviceId) {
        if (deviceId == null){
            return null;
        }
        LambdaQueryWrapper<DeviceSyncSettings> lambdaQuery = Wrappers.lambdaQuery();
        lambdaQuery.eq(DeviceSyncSettings::getDeviceId, deviceId);
        return this.getOne(lambdaQuery);
    }
}

